package com.app.utils.impl.labour;

import com.app.utils.impl.IConsole;
import com.app.utils.impl.Strategy;
import com.zndroid.utils.XUtils;
import com.zndroid.utils.impl.PatternUtil;

/**
 * Created by lzy on 2022/2/15.
 */
public class PatternUtilStrategy extends Strategy {

    public PatternUtilStrategy(IConsole iConsole) {
        super(iConsole);
    }

    @Override
    public void doing() {
        PatternUtil util = XUtils.create().patternUtil();

        iConsole.console("formatMicrometer(‘12345678.123456’)", util.formatMicrometer("12345678.123456"));

        iConsole.console("isPhoneNumber(‘123’)", util.isPhoneNumber("123") + "");
        iConsole.console("isPhoneNumber(‘13855641128’)", util.isPhoneNumber("13855641128") + "");

        iConsole.console("isUrl(‘www.baidu.com’)", util.isUrl("www.baidu.com") + "");
        iConsole.console("isUrl(‘http://www.baidu.coom’)", util.isUrl("http://www.baidu.coom") + "");

        iConsole.console("isIP(‘123456’)", util.isIP("123456") + "");
        iConsole.console("isIP(‘127.0.0.1’)", util.isIP("127.0.0.1") + "");

        iConsole.console("isStartWithLetter(‘123456’)", util.isStartWithLetter("123456") + "");
        iConsole.console("isStartWithLetter(‘A123456’)", util.isStartWithLetter("A123456") + "");

        iConsole.console("isWithLetterOrNumber(‘123*’)", util.isStartWithLetter("123*") + "");
        iConsole.console("isWithLetterOrNumber(‘12A34a56’)", util.isStartWithLetter("12A34a56") + "");

        iConsole.console("isWithLetterAndNumberOr_(‘123*’)", util.isWithLetterAndNumberOr_("123*") + "");
        iConsole.console("isWithLetterAndNumberOr_(‘12A34a56_’)", util.isWithLetterAndNumberOr_("12A34a56_") + "");

        iConsole.console("isWithCNAndLetterAndNumberOr_(‘123*’)", util.isWithCNAndLetterAndNumberOr_("123*") + "");
        iConsole.console("isWithCNAndLetterAndNumberOr_(‘12哈哈A34a56_’)", util.isWithCNAndLetterAndNumberOr_("12哈哈A34a56_") + "");

        iConsole.console("isWithCNAndLetterAndNumberNot_(‘123’)", util.isWithCNAndLetterAndNumberNot_("123") + "");
        iConsole.console("isWithCNAndLetterAndNumberNot_(‘12哈哈A34a56_’)", util.isWithCNAndLetterAndNumberNot_("12哈哈A34a56_") + "");

        iConsole.console("isEmail(‘123’)", util.isEmail("123") + "");
        iConsole.console("isEmail(‘123@qq.com’)", util.isEmail("123@qq.com") + "");

        iConsole.console("isIDCard(‘123’)", util.isIDCard("123") + "");
        iConsole.console("isIDCard(‘35425689746598746X’)", util.isIDCard("35425689746598746X") + "");

        iConsole.console("isCar(‘AT78LP’)", util.isCar("AT78LP") + "");
        iConsole.console("isCar(‘浙AT78LP’)", util.isCar("浙AT78LP") + "");

        iConsole.console("isTel(‘123’)", util.isTel("123") + "");
        iConsole.console("isTel(‘8856669’)", util.isTel("8856669") + "");

        iConsole.console("isHasCN(‘123’)", util.isHasCN("123") + "");
        iConsole.console("isHasCN(‘12哈哈A34a56_’)", util.isHasCN("12哈哈A34a56_") + "");

        iConsole.console("hidePhoneNumber(‘13755667893’)", util.hidePhoneNumber("13755667893") + "");

        iConsole.console("hideBankCard(‘1234567890123456789’)", util.hideBankCard("1234567890123456789") + "");

        iConsole.console("hideIDCard(‘35425689746598746X’)", util.hideIDCard("35425689746598746X") + "");
        iConsole.console("hideIDCard(‘354256897465987’)", util.hideIDCard("354256897465987") + "");
    }
}
